package userclass;

import java.io.Serializable;

public class User implements Comparable<User>,Serializable{

	private String name;
	private long ID;
	private String password;

	
	
	public User(String name, long iD, String password) {
		super();
		this.name = name;
		ID = iD;
		this.password = password;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public long getID() {
		return ID;
	}
	public void setID(long iD) {
		ID = iD;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (ID ^ (ID >>> 32));
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (ID != other.ID)
			return false;
		return true;
	} 	
	
	@Override
	public String toString() {
		return name+"   \t\t"+ID;
	}
	
	
	@Override
	public int compareTo(User o) {
 
		return (int) (ID-o.ID);
	}

	
}
